package lupita.model.vos;

import java.io.Serializable;
import java.math.BigDecimal;

public class Rating implements Serializable{


	/**
	 * 
	 */
	private static final long serialVersionUID = -8858418953910280695L;

	private Long id;
	
	private Long rating;
	
	private Long totalVotes;
	
	private FileSystemItem file;
	
	public Double getPopularity() {
		
		double popular = this.rating/this.totalVotes;        
        int decimalPlace = 2;
        BigDecimal bd = new BigDecimal(popular);
        bd = bd.setScale(decimalPlace, BigDecimal.ROUND_UP);
        popular = bd.doubleValue();
        
        popular = popular / 5;
		
		return popular;
	}
	
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getTotalVotes() {
		return totalVotes;
	}

	public void setTotalVotes(Long votes) {
		this.totalVotes = votes;
	}

	public FileSystemItem getFile() {
		return file;
	}

	public void setFile(FileSystemItem file) {
		this.file = file;
	}

	public Long getRating() {
		return rating;
	}

	public void setRating(Long rating) {
		this.rating = rating;
	}
	
	
}
